#ifndef PACKETH
#define PACKETH

#define CONN_SYN_N			0
#define CONN_SYN_ACK_N		1
#define CONN_ACK_N			2
#define ALIVE_SYN_N			3
#define ALIVE_ACK_N			4
#define DISCONN_SYN_N		5
#define DISCONN_SYN_ACK_N	6
#define DISCONN_ACK_N		7
#define FIN_N				8
#define ERROR_N				9
#define INFO_N				10
#define INFO_7_N			11
#define UPDATE_N    		12

#define DIR_NUM             (10)

#define FREEMB_LEN          16
#define LOGIN_LEN           32
#define PASSWD_LEN          32
#define MAX_TYPE_LEN        16
#define MAX_MSG_LEN         (235)

#ifndef WIN32
typedef long long __int64;
#endif

//-----------------------------------------------------------------------------
struct CONN_SYN
{
char            magic[6];
char            protoVer[2];
char	        loginS[LOGIN_LEN];
int 	        len;
char 	        type[MAX_TYPE_LEN];
char	        login[LOGIN_LEN];
};
//-----------------------------------------------------------------------------
struct CONN_SYN_ACK
{
int 	        len;
char 	        type[MAX_TYPE_LEN];
unsigned int    rd;
int		        userTimeOut;
int		        aliveDelay;
string16        dirName[DIR_NUM];
};
//-----------------------------------------------------------------------------
struct CONN_ACK
{
char            magic[6];
char            protoVer[2];
char	        loginS[LOGIN_LEN];
int 	        len;
char 	        type[MAX_TYPE_LEN];
unsigned int	rd;
};
//-----------------------------------------------------------------------------
struct ALIVE_SYN
{
int 	        len;
char 	        type[MAX_TYPE_LEN];
unsigned int	rd;

__int64	        mu[DIR_NUM];
__int64	        md[DIR_NUM];

__int64	        su[DIR_NUM];
__int64	        sd[DIR_NUM];

__int64	        cash; // Деньги умноженные на 1000
char            freeMb[FREEMB_LEN];
};
//-----------------------------------------------------------------------------
struct ALIVE_ACK
{
char            magic[6];
char            protoVer[2];
char	        loginS[LOGIN_LEN];
int 	        len;
char 	        type[MAX_TYPE_LEN];
unsigned int	rd;
};
//-----------------------------------------------------------------------------
struct DISCONN_SYN
{
char            magic[6];
char            protoVer[2];
char	        loginS[LOGIN_LEN];
int 	        len;
char 	        type[MAX_TYPE_LEN];
char	        login[LOGIN_LEN];
};
//-----------------------------------------------------------------------------
struct DISCONN_SYN_ACK
{
int 	        len;
char 	        type[MAX_TYPE_LEN];
unsigned int	rd;
};
//-----------------------------------------------------------------------------
struct DISCONN_ACK
{
char            magic[6];
char            protoVer[2];
char	        loginS[LOGIN_LEN];
int 	        len;
char 	        type[MAX_TYPE_LEN];
unsigned int	rd;
};
//-----------------------------------------------------------------------------
struct FIN
{
int 	        len;
char 	        type[MAX_TYPE_LEN];
char	        ok[3];
};
//-----------------------------------------------------------------------------
struct ERR
{
int 	        len;
char 	        type[MAX_TYPE_LEN];
char	        text[236];
};
//-----------------------------------------------------------------------------
struct INFO
{
int             len;
char            type[MAX_TYPE_LEN];
char            infoType;
char            text[MAX_MSG_LEN];
};
//-----------------------------------------------------------------------------
struct INFO_7
{
int         len;
char        type[MAX_TYPE_LEN];
char        infoType;
unsigned    sendTime;
char        showTime;
char        text[MAX_MSG_LEN];
char        padding[3];
};
//-----------------------------------------------------------------------------
struct LOADSTAT
{
__int64 mu[DIR_NUM];
__int64 md[DIR_NUM];

__int64 su[DIR_NUM];
__int64 sd[DIR_NUM];

__int64	cash;   // Деньги умноженные на 1000
char freeMb[FREEMB_LEN];
};
//-----------------------------------------------------------------------------
#endif


